#pragma once
#include "SnRender.h"
#include "base/SnImage.h"
#include "base/shader.h"
#include <memory>
#include <vector>
namespace Sivin {
  class YUVRender : public SnRender {
    struct SnVertex {
      GLfloat postion[3];
      GLfloat texCoord[2];
    };

  public:
    explicit YUVRender();
    ~YUVRender();

  public:
    void onGLInit() override;
    void onRender() override;

  private:
    void initVAO();
    void initTexture();

  private:
    GLuint mVAO;

    GLuint mYTextureId{0};
    GLuint mUTextureId{0};
    GLuint mVTextureId{0};

    std::unique_ptr<Shader> mShader{nullptr};
    std::vector<SnVertex> mVertexData;
    std::vector<GLuint> mElementIndexArray;
  };
}// namespace Sivin